<!--
  
   FacilityEditor.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<UserControl x:Class="Supremacy.Editor.FacilityEditor"
             xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
             xmlns:s="clr-namespace:Supremacy.Client;assembly=SupremacyWPF"
             xmlns:local="clr-namespace:Supremacy.Editor"
             xmlns:tech="clr-namespace:Supremacy.Tech;assembly=SupremacyCore"
             xmlns:econ="clr-namespace:Supremacy.Economy;assembly=SupremacyCore"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <Grid Margin="12,0,0,12">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"
                        SharedSizeGroup="EditorLeftColumnGroup" />
      <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <Label Grid.Column="0"
           Grid.Row="0"
           Margin="0,3,2,3"
           Target="{Binding ElementName=CategoryList}"
           Content="_Production Category:"
           FontWeight="Bold"/>
    <ComboBox Name="CategoryList"
              Grid.Column="1"
              Grid.Row="0"
              Margin="2,3,2,3"
              HorizontalAlignment="Left"
              SelectedItem="{Binding Path=Category, Mode=TwoWay}"/>

    <Label Grid.Column="0"
           Grid.Row="1"
           Margin="0,3,2,3"
           Target="{Binding ElementName=LaborCostText}"
           Content="_Labor Cost:"
           FontWeight="Bold"/>
    <TextBox x:Name="LaborCostText"
             Grid.Column="1"
             Grid.Row="1"
             Margin="2,3,2,3"
             Width="64"
             HorizontalAlignment="Left">
      <TextBox.Text>
        <Binding Path="LaborCost"
                 Mode="TwoWay">
          <Binding.ValidationRules>
            <local:NonEmptyValidationRule/>
            <local:RangeValidationRule Min="1"
                                       Max="255"/>
          </Binding.ValidationRules>
        </Binding>
      </TextBox.Text>
    </TextBox>

    <Label Grid.Column="0"
           Grid.Row="2"
           Margin="0,3,2,3"
           Target="{Binding ElementName=UnitOutputText}"
           Content="_Unit Output:"
           FontWeight="Bold"/>
    <TextBox x:Name="UnitOutputText"
             Grid.Column="1"
             Grid.Row="2"
             Margin="2,3,2,3"
             Width="64"
             HorizontalAlignment="Left">
      <TextBox.Text>
        <Binding Path="UnitOutput"
                 Mode="TwoWay">
          <Binding.ValidationRules>
            <local:NonEmptyValidationRule/>
            <local:RangeValidationRule Min="0"
                                       Max="65535"/>
          </Binding.ValidationRules>
        </Binding>
      </TextBox.Text>
    </TextBox>

  </Grid>

</UserControl>
